﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cinemachine;

namespace linkouqs.Gamekit
{

public static class CinemachineTargetGroupExtensions {

    public static void AddTagets(this CinemachineTargetGroup targetGroup, params Transform[] transforms)
    {
        var arr = targetGroup.m_Targets;
        List<CinemachineTargetGroup.Target> targets = new List<CinemachineTargetGroup.Target>();
        targets.AddRange(arr);
        foreach(var trans in transforms)
        {
            targets.Add(new CinemachineTargetGroup.Target()
            {
                target = trans,
                weight = 1,
                radius = 0
            });
        }
        targetGroup.m_Targets = targets.ToArray();
    }

}

}
